<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<head>
<%
	String path = request.getContextPath();		//项目名称
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.css"/>
<link rel="stylesheet" href="<%=basePath %>css/buttons.css" />
<script type="text/javascript" src="<%=basePath %>js/jquery-1.9.1.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript">
$(document).ready(function(){
	$("#btnUpdate").click(function() {
        var $form = $("form");
        $.ajax({
            cache: true,
            type: "POST",
            url: $form.attr("action"),	//提交的url
            data: $form.serialize(), 	
            async: false,
            success: function (data) {
            	alert("修改成功");
                location.reload();
            },
            error: function (request) {
                alert("出错了");
                location.reload();
            }
        });
    });
});
</script>
<body>
	<center>
		<form action="<%=basePath %>userInfo/updatePersonalcredit?userinfo=${userList }" method="post">
			<table border="0">
				<c:forEach items="${userList }" var="user">
					<tr>
						<td>姓名：</td>
						<td>${user.fusername }
							<div style="display: none;"><input type="text" name="fid" value="${user.fid }"/></div>
						</td>
					</tr>	
					<tr>
						<td>
							信用评级：
							<select id="personalcredit" name="personalcredit" class="form-control" style="width:160px;height:30px;">
								<option value="1" <c:if test="${user.personalcredit == '1' }">selected</c:if>>1</option>
								<option value="2" <c:if test="${user.personalcredit == '2' }">selected</c:if>>2</option>
								<option value="3" <c:if test="${user.personalcredit == '3' }">selected</c:if>>3</option>
								<option value="4" <c:if test="${user.personalcredit == '4' }">selected</c:if>>4</option>
								<option value="5" <c:if test="${user.personalcredit == '5' }">selected</c:if>>5</option>
							</select><br />
						</td>
					</tr>
					<tr>
						<td><input type="button" value="修改" id="btnUpdate"
						class="button button-pill button-primary" style="width:140px;height:40px;"/></td>
						<td><a href="<%=basePath %>selPersonalcredit.jsp"><input type="button" value="返回"
						class="button button-pill button-primary" style="width:140px;height:40px;"/></a></td>
					</tr>
				</c:forEach>
			</table>
		</form>
	</center>
</body>
</html>